package day1107;

/**
 * @author Mr.ma
 * @since 2022/11/7 19:09
 * 懒汉式
 **/
public class SingleTonLazy {
    private static SingleTonLazy singleTonLazy;
    private SingleTonLazy(){}
    public static SingleTonLazy getInstance(){
        if (singleTonLazy == null){
            synchronized(SingleTonLazy.class){
                if (singleTonLazy == null){
                    singleTonLazy = new SingleTonLazy();
                }
            }
        }
        return singleTonLazy;
    }
}
